<script type="text/javascript" src="${base}/scripts/xsgl/xsddetail.js"></script>
<div id="xsd_tabs" class="easyui-tabs" detail="true" data-options="fit:true,border:false">
<input type="hidden" id="xsd_id" value="${(xsd.id)!}"/>
<input type="hidden" id="xsd_xsdh" value="${(xsd.xsdh)!}"/>
<input type="hidden" id="xsd_ewmtime" value="${(ewmtime)!}"/>
<#--<input type="hidden" id="xsd_detail_xslx" name="xsd.xslx" value="<#if xsd??>${(xsd.xslx)!}<#else>${xslx}</#if>"/>-->
<input type="hidden" id="xsd_detail_xslx" value="${(xsd.xslx)!}"/>
<input type="hidden" id="xsd_detail_sl" value="${(xsd.sl)!}"/>

<div title="销售信息">
    <table style="width: 100%" class="tb tab-t t-bor">
        <col width="70px"/>
        <col width=""/>
        <col width="70px"/>
        <col width=""/>
        <col width="70px"/>
        <col width=""/>
        <tr>
            <th style="color:#f45212;">
                销售单号：
            </th>
            <td>
            ${(xsd.xsdh)!}
            </td>
            <th>路&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;径：</th>
            <td colspan="3">
            <#if xsd?? && xsd.lj??>
                <span class="ljtip">  ${(xsd.lj.mc)!}</span>
            </#if>
            </td>
            <input id="xsd_detail_ljtip" value="${(xsd.lj.id)!}" type="hidden"/>
        </tr>
        <tr>
            <th>销售合同：</th>
            <td>
                <a href="javascript:void(0)" onclick="viewXsdglXshtDetail('${(xsd.xsht.id)!}')">
                ${(xsd.xsht.htbm)!}
                </a>
            </td>
            <th>销售类型：</th>
            <td>
            <#if xsd.xslx?? && xsd.xslx=="htxs" >合同销售<#else>
                <#if xsd.xslx?? && xsd.xslx=="kcls" >库存零售<#elseif xsd.xslx?? && xsd.xslx=="zddh" >直达到货<#else>保供销售
                </#if>
            </#if>
            </td>

            <th>客&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;户：</th>
            <td>
            ${(xsd.kh.qc)!}
            </td>
        </tr>
        <tr>
            <th>工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;程：</th>
            <td>
            ${(xsd.gc.mc)!}
            </td>
            <th>提货仓库：</th>
            <td>
            ${(xsd.thck.mc)!}
            </td>
            <th>开单日期：</th>
            <td>
            ${(xsd.sxsj?datetime)!}
            </td>
        </tr>
        <tr>
            <th>计划发货：</th>
            <td>
            ${(xsd.fhsj?date)!}
            </td>
            <th>税&nbsp;率(%)：</th>
            <td>
            ${(xsd.sl?string("0.0000"))!}
            </td>
            <th>状态：</th>
            <input id="xsdzt" type="hidden" value="${(xsd.zt)!}"/>
            <td>
            <#if xsd??&&xsd.zt??&&xsd.zt == 'ybc'>已保存<#else><#if xsd??&&xsd.zt??&&xsd.zt == 'ytj'>已提交<#else>
                已审批</#if></#if>
            </td>
        </tr>
        <tr>
            <th>发运责任：</th>
            <td>
            ${(xsd.fyzr.z)!}
            </td>
            <th>代收费用：</th>
            <td>
            ${(xsd.dsyfje?string(",##0.0000"))!}
            </td>
            <th>提&nbsp;货&nbsp;&nbsp;人：</th>
            <td>
            ${(xsd.thr)!}
            </td>
        </tr>
        <tr>
            <th>交货时间：</th>
            <td>
            ${(xsd.jhsj?datetime)!}
            </td>
            <th>送货地址：</th>
            <td>
            ${(xsd.jhdz)!}
            </td>
            <th>放货方式：</th>
            <td>
            <#if xsd??&&xsd.fhfs??&&xsd.fhfs == 'self'>自提<#else><#if xsd??&&xsd.fhfs??&&xsd.fhfs == 'transfer'>过户<#else>
                未知</#if></#if>
            </td>
            </td>
        </tr>
        <tr>
            <th>收&nbsp;货&nbsp;&nbsp;人：</th>
            <td>
            ${(xsd.shry)!}
            </td>
            <th>联系电话：</th>
            <td>
            ${(xsd.shrdh)!}
            </td>
            <th>交货要求：</th>
            <td>
            ${(xsd.jhyq)!}
            </td>
        </tr>
    <#if xsd?? && xsd.xslx?? && xsd.xslx=="kcls" >
        <tr>
            <th>已&nbsp;审&nbsp;核：</th>
            <td>
                <#if xsd.cwsh??&&xsd.cwsh>是<#else>否</#if>
            </td>
            <th>审核时间：</th>
            <td>
            ${(xsd.shsj?datetime)!}
            </td>
            <th>审&nbsp;核&nbsp;&nbsp;人：</th>
            <td>
            ${(xsd.shr.xm)!}
            </td>
        </tr>
    </#if>
    <#if xsd?? && xsd.xslx?? && xsd.xslx!="zddh" >
        <tr>
            <th>已&nbsp;出&nbsp;库：</th>
            <td>
                <#if xsd.yck??&&xsd.yck>是<#else>否</#if>
            </td>
            <th>出库时间：</th>
            <td>
            ${(xsd.cksj?datetime)!}
            </td>
            <th>出&nbsp;库&nbsp;&nbsp;人：</th>
            <td>
            ${(xsd.ckr.xm)!}
            </td>
        </tr>
    </#if>
    <#if  xsd?? && xsd.xslx?? && xsd.xslx="zddh">
        <th>采购单号:</th>
        <td>${(cgd.cgdh)!}</td>
        <th>采购合同：</th>
        <td>
        ${(cgd.cght.htbm)!}
        </td>
        <th>供&nbsp;&nbsp;应&nbsp;&nbsp;商：</th>
        <td>
        ${(cgd.gys.jc)!}
        </td>
    </#if>
        <tr>
            <th>申报公司：</th>
            <td>
            ${(xsd.sbgs.jc)!}
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
            ${(xsd.sbr.xm)!}
            </td>
            <th>销售公司：</th>
            <td>
            ${(xsd.xsgs.jc)!}
            </td>
        </tr>

        <tr>
            <th>结算状态：</th>
            <td>
            ${(jszt)!''}
            </td>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td colspan="3">
            ${(xsd.bz)!}
            </td>
        </tr>
        <tr>
            <th>制&nbsp;单&nbsp;&nbsp;人：</th>
            <td>${(xsd.createUser.xm)!}</td>
            <th>制单时间：</th>
            <td>${(xsd.dateCreated?datetime)!}</td>
        </tr>
    </table>
</div>

<div title="销售明细">
    <table id="xsd_xsdmx_table">
    </table>
</div>

<div title="挂款明细">
    <table id="xsd_jfmx_table" class="easyui-datagrid" url="${base}/xsgl/xsdgl/xsdgkmx?xsdId=${(xsd.id)!}"
           rownumbers="true" fit="true" fitColumns="true" showFooter="true">
        <thead>
        <tr>
            <th data-options="field:'BM',width:180,align: 'center'">收款单据号</th>
            <th data-options="field:'SFJE',width:100,align: 'center'">收款金额</th>
            <th data-options="field:'YE',width:100,align: 'center'">余额</th>
            <th data-options="field:'SJJE',width:100,align: 'center'">使用金额</th>
            <th data-options="field:'KXSY',width:150,align: 'center'">款项用途</th>
            <th data-options="field:'FKFS',width:150,align: 'center'">付款方式</th>
            <th data-options="field:'SYFS',width:150,align: 'center'">款项使用方式</th>
            <th data-options="field:'FKSJ',width:100">付款时间</th>
        </tr>
        </thead>
    </table>
</div>
</div>

